
CREATE PROCEDURE Sp_Ins_IntExtension

	@nIntCodigo	int ,
	@nIntClase int ,
	@cIntData varchar(150),
	@nIntSubClase int

as

begin
 
	declare @nItem int

	select @nItem = isnull(MAX(nItem),0) from IntExtension where nIntCodigo = @nIntCodigo and nIntClase = @nIntClase

	INSERT INTO IntExtension values (@nIntCodigo,@nIntClase,@nItem + 1 ,@cIntData,@nIntSubClase)

end